package com.jwgf.table;

import android.graphics.Color;
import android.widget.TextView;

import com.jwgf.adapter.ItemViewDelegate;
import com.jwgf.adapter.RecyclerViewHolder;
import com.jwgf.smarowindingmachine_unity.R;

public class TextViewDelegate implements ItemViewDelegate {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.item_text_view;
    }

    @Override
    public boolean isForViewType(Object item, int position) {
        return true;
    }

    @Override
    public void bindView(RecyclerViewHolder holder, Object o, int position) {
        String value = (String) o;
        ((TextView)holder.getView(R.id.text)).setTextColor(Color.rgb(0, 0, 0));
        holder.setText(R.id.text, value);
    }
}
